package rulebase;

import java.awt.CardLayout;
import java.awt.event.ActionListener;

import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;


public class MorphophoneticSpelloutRulePanel extends JPanel
{
	private JPanel pnlEleven  = new MorphophoneticPrefixSpelloutRulePanel();
	private JPanel pnlTwelve = new MorphophoneticSuffixSpelloutRulePanel();
	
	private JPanel pnlTen;

	private JComboBox cbxMorphophoneticModification;
	
	public MorphophoneticSpelloutRulePanel()
	{
		setLayout(null);
		initGUI();
	}
	
	private void initGUI()
	{
		setSize(444,421);
		setLayout(null);
		
		JLabel lblTableModification = new JLabel("Modification");
		lblTableModification.setBounds(10, 11, 57, 14);
		add(lblTableModification);
		
		pnlTen = new JPanel();
		pnlTen.setBounds(10, 49, 424, 361);
		add(pnlTen);
		pnlTen.setLayout(new CardLayout(0, 0));
		
		cbxMorphophoneticModification = new JComboBox();
		cbxMorphophoneticModification.setBounds(77, 11, 150, 20);
		add(cbxMorphophoneticModification);
		initMorphophoneticModificationItems();
		
		pnlTen.add(pnlEleven,"Prefix");
		pnlTen.add(pnlTwelve, "Suffix");
	}
	
	private void initMorphophoneticModificationItems()
	{
		DefaultComboBoxModel  model = new DefaultComboBoxModel();
		model.addElement("Prefix");
		model.addElement("Suffix");
		cbxMorphophoneticModification.setModel(model);
	}
	
	public String getCbxMorphophoneticModification()
	{
		return (String) cbxMorphophoneticModification.getSelectedItem();
	}
	
	public void setCbxMorphophoneticModification(String s)
	{
		cbxMorphophoneticModification.setSelectedItem(s);
	}
	
	public void setCbxMorphophoneticModificationListener(ActionListener AL)
	{
		cbxMorphophoneticModification.addActionListener(AL);
	}
	
	public JPanel getPnlTen() 
	{
		return pnlTen;
	}

	public void setPnlTen(JPanel pnlTen) {
		this.pnlTen = pnlTen;
	}
	
	public JPanel getPnlEleven() 
	{
		return pnlEleven;
	}

	public void setPnlEleven(JPanel pnlEleven) 
	{
		this.pnlEleven = pnlEleven;
	}

	public JPanel getPnlTwelve() 
	{
		return pnlTwelve;
	}

	public void setPnlTwelve(JPanel pnlTwelve) 
	{
		this.pnlTwelve = pnlTwelve;
	}

}
